﻿using KPIS.GERP.SERVICE.Model.Resources;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KPIS.GERP.SERVICE.Model
{
    public class CustomRequiredAttribute : RequiredAttribute
    {
        public CustomRequiredAttribute()
        {
            base.ErrorMessageResourceName = "RequiredMessage";
            base.ErrorMessageResourceType = typeof(ErrorMessage);
        }

        //public MyStringLengthAttribute(int maximumLength)
        //    : base(maximumLength)
        //{
        //    base.ErrorMessageResourceName = "StringLengthMessage";
        //    base.ErrorMessageResourceType = typeof(ErrorMessage);
        //}
    }

    public class CustomStringLengthAttribute : StringLengthAttribute
    {
        public CustomStringLengthAttribute()
            : this(255)
        {
        }

        public CustomStringLengthAttribute(int maximumLength) : base(maximumLength)
        {
            base.ErrorMessageResourceName = "StringLengthMessage";
            base.ErrorMessageResourceType = typeof(ErrorMessage);
        }
    }
}
